<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新闻详情</title>
    <link type="text/css" rel="stylesheet" href="css/index.css">
    <!-- 引入相关插件，也叫依赖-->
    <!--引入vue的依赖，必须在elementui之前引入vue-->
    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript" src="js/axios.min.js"></script>
</head>
<div id="app">
    <div>
        <a href="/newsTopic.html" class="button btn-success" style="font-size: 20px">返回首页</a>
    </div>

    <div align="center">
        <p v-text="info.newsTitle" style="color: darkred;font-size: 30px"></p>
    </div>
    <div style="text-align: center;margin: 0 auto">
        <div class="col-md-3">
            <p v-text="info.kind.name" style="color: chartreuse;font-size: 25px"></p>
        </div>
        <div>
            <p v-html="info.newsAuthor" style="font-size: 25px"></p>
            <p v-html="info.newsTime" style="font-size: 25px">
            <p v-html="info.newsClick" style="font-size: 25px"></p>
        </div>


    </div>
    <div style="font-size: 20px" v-html="info.newsContent"></div>
</div>

<script>
    var id = window.location.href.split("=")[1];
    var app=new Vue({
        el:"#app",
        data:{
            info:{}
        },
        created(){
            this.initContent();
        },
        methods:{
            //详细新闻内容
            initContent() {
                axios.post("news/queryReason?id="+id).then(resp=>{
                    console.log(resp)
                    this.info = resp.data.data
                })
            }
        }
    })

</script>
</body>
</html>